package com.woniuxy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.woniuxy.entity.Lessee;

@Mapper
public interface LesseeMapper {
	//查询所有租户
	@Select("select * from t_lessee")
	public List<Lessee> findAllLessee();
	
	//根据状态查询租户
	@Select("select * from t_lessee where status=#{status}")
	public List<Lessee>findLesseeByStatus(int status);
	//模糊查询
	@Select("select * from t_lessee where lname like CONCAT('%',#{words},'%') or lcode like CONCAT('%',#{words},'%')")
	public List<Lessee>findLesseeByWords(String words);
	//新建租户
	@Insert("insert into t_lessee values(default,#{rname},#{rcode},#{status},#{description},#{ctime})")
	public int insertLessee(Lessee lessee);
	//删除租户
	@Delete("delete from t_lessee where lid=#{lid}")
	public int delByLid(int lid);
}
